import {ChangeDetectorRef, Component} from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
import {JidihttpProvider} from "../../providers/jidihttp/jidihttp";

/**
 * Generated class for the HuifuPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@Component({
  selector: 'page-huifu',
  templateUrl: 'huifu.html',
})
export class HuifuPage {
  huifuid:string;
  /** baike **/
  huifuMoviesbozhu: Array<any>=[];
  /** baike **/
  tasklisthuifu:Array<any>=[];//list列表

  constructor(public navCtrl: NavController, public navParams: NavParams,public jidiProvider:JidihttpProvider,public cdchange:ChangeDetectorRef) {
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad HuifuPage');
    this.huifuid=this.navParams.get('uuid')
    this.huifuhttpInfoClinet(this.huifuid);
  }

  /** 网络请求 **/
  huifuhttpInfoClinet(id){
    this.jidiProvider.huiFuClick(this.huifuid).subscribe(data => {
      if(data['data']['length']>0){
        for(let i=0;i<data['data']['length'];i++){
          this.huifuMoviesbozhu.push(data['data'][i]);
        }
        //alert(this.jidiMovies);
        this.tasklisthuifu=this.huifuMoviesbozhu;
        this.cdchange.detectChanges();
      }
    },error => {

    });

  }

}
